/*
* Copyright (c) Huawei Technologies Co., Ltd. 2022. All rights reserved.
*/

#ifndef MEM_ALLOCATER_H
#define MEM_ALLOCATER_H

#include "mem_pool_comm.h"

void create_mem_pool(struct mem_pool_info** mem_pool, struct mutex* mtx);
int32_t init_mem_allocater(init func, struct mem_pool_info* mem_pool, uint32_t node_num,
    uint32_t node_size, struct mutex* mtx);
void destroy_mem_pool(deinit func, struct mem_pool_info** mem_pool, struct mutex* mtx);
struct mem_node* alloc_node_from_pool(struct mem_pool_info* mem_pool);
void free_node_to_pool(struct mem_node* node, struct mem_pool_info* mem_pool);

#endif // #ifndef MEM_ALLOCATER_H
